package com.effective.java.taggedclasses;

/**
 * Class allowing for initializing new rectangle instances and offering the
 * capabilities in order to calculate their area.
 * 
 * @author andreas.landerer
 * 
 */
public class Rectangle extends AbstractFigure {

	/**
	 * The length of a rectangle.
	 */
	private final double length;

	/**
	 * The width of a rectangle.
	 */
	private final double width;

	/**
	 * Constructor used in order to initialize a new rectangle.
	 * 
	 * @param length
	 *            length of the rectangle
	 * @param width
	 *            width of the rectangle
	 */
	public Rectangle(double length, double width) {

		this.length = length;
		this.width = width;
	}

	@Override
	public double area() {

		return this.length * this.width;
	}
}
